package com.shu.util;

import java.util.Collection;

public class CollectionUtils {
	
	public static <T> Object getFirstElement(Collection<T> collection) {
		if(collection.size()>0) {
			return collection.iterator().next();
		}
		return null;
	}
	
//	public static void main(String[] args) {
//		List<SysUser> userList = new ArrayList<>();
//		SysUser user = new SysUser();
//		user.setAccount("aaa");
//		userList.add(user);
//		System.out.println(((SysUser)CollectionUtils.getFirstElement(userList)).getAccount());
//	}

}
